/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * CDialogoBd.java
 *
 * Created on 01/11/2010, 13:40:56
 */

package rpt.bd.cenario;

import javax.swing.Icon;
import javax.swing.JButton;
import javax.swing.JPanel;

/**
 *
 * @author Roberto
 */
public class CDialogoBd extends javax.swing.JPanel {

    protected CGlobal fGlobal = null;
    protected JPanel fDialogoCentral;
    protected CPersistenciaBd fPertinenciaBd;

    public CDialogoBd(final CGlobal aGlobal, final CPersistenciaBd aPertinenciaBd) {
        initComponents();
        fGlobal = aGlobal;
        fPertinenciaBd = aPertinenciaBd;
    }

    /**************************************************************************/
    /***                                                                    ***/
    /**************************************************************************/

    private class CBotalGeral1 extends CBotaoGeral {

    }

    /**************************************************************************/
    /***                                                                    ***/
    /**************************************************************************/

    public Object prepararBotao(final JButton aComponenteBotao, final CBotaoGeral aBotao) {
        final boolean v = (aBotao != null);
        aComponenteBotao.setVisible(v);
        if (v) {
            if (aBotao.label() != null) {
                aComponenteBotao.setToolTipText(aBotao.label());
            }
            Icon i = null;
            final String vArq = aBotao.arqImagem();
            if (aBotao.arqImagem() != null) {
                i = fGlobal.getIcon(vArq);
            }
            if (i != null) {
                aComponenteBotao.setIcon(i);
            } else {
              aComponenteBotao.setText(aBotao.label());
            }
        }
        return aBotao;
    }

    /**************************************************************************/
    /***                                                                    ***/
    /**************************************************************************/

    public int AdicionarDialogoCentral(final JPanel aDialogoCentral) {
       fDialogoCentral = aDialogoCentral;
       PainelCentral().add(fDialogoCentral);
       return 1;
    }

    /**************************************************************************/
    /***                                                                    ***/
    /**************************************************************************/

    public CPersistenciaBd getPertinenciaBd() {
        return fPertinenciaBd;
    }

    /**************************************************************************/
    /***                                                                    ***/
    /**************************************************************************/

    public JPanel PainelCentral() {
       return null;
    }






    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */





    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 400, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 300, Short.MAX_VALUE)
        );
    }// </editor-fold>//GEN-END:initComponents


    // Variables declaration - do not modify//GEN-BEGIN:variables
    // End of variables declaration//GEN-END:variables

}
